package cn.com.ddapp.ddm.util.OKHttpUtils;

import com.zhy.http.okhttp.builder.PostFormBuilder;
import com.zhy.http.okhttp.request.RequestCall;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by caopenghui on 2016-08-29.
 */
public class FileFormBuilder extends PostFormBuilder {

    private List<FileInput> files = new ArrayList<>();

    @Override
    public RequestCall build()
    {
        return new FileFormRequest(url, tag, params, headers, files,id).build();
    }

    public FileFormBuilder addFile(String name, String filename, File file)
    {
        files.add(new FileInput(name, filename, file));
        return this;
    }

}

